﻿
using hdal;
using hentity;
using hhttp;
using hq;
using System;
using System.Collections.Generic;
using System.Web.Http;
 namespace htaskCommon {
    [RoutePrefix("param")]
    public class ParamServe :BaseApiController {
        IWCSServer wcsServer = WMSDalFactray.getDal<IWCSServer>();
        [HttpGet, Route("updateCraneOverStop/{craneId}/{value}")]
        public bool UpdateCraneOverStop(int craneId ,int value) {
            return wcsServer.update("crane" ,craneId ,"overStop" ,value);
        }
         [HttpGet, Route("GetCraneOverStop/{craneId}")]
        public BaseResult GetCraneOverStop(int craneId) {
            BParam param = wcsServer.getById<BParam>(craneId );
            return BaseResult.Ok(param.v);
        }
         [HttpGet, Route("updateParam/{driveType}/{driveId}/{key}/{value}")]
        public BaseResult updateParam(string driveType ,int driveId ,string key ,int value) {
            bool res = wcsServer.update(driveType ,driveId ,key,value);
            return BaseResult.Ok(res);
        }
        [HttpGet, Route("getParams")]
        public BaseResult getParams() {
            List<BParam> res = wcsServer.getParams( );
            return BaseResult.Ok(res);
        }
    }
 }
